package cn.com.graPro.controller;

import cn.com.graPro.service.ImgCensorService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


@RestController
	@RequestMapping("/imgRecController")
public class ImgCensorController {
	private static final Logger LOG = LoggerFactory.getLogger(GetAuthController.class);

	@GetMapping("/imgCensorUrl")
	public String imgCensorUrl(@RequestParam(name = "imageUrl") String imageUrl,
			@RequestParam(name = "type") String type) {
		LOG.info("imgCensor({},{})", imageUrl,type);
		String result = ImgCensorService.ImgCensorUrl(imageUrl, type);
		return result;
	}

	/*
	* 可以进行政治人物的识别
	* 2019年5月25日12:50:40测试可用
	* */
	@GetMapping("/politcRec")
	public String imgCensorFile(@RequestParam(name = "imageUrl") String imageUrl) {
		LOG.info("imgCensor({})", imageUrl);
		String result = ImgCensorService.ImgCensorUrl(imageUrl, "politician");
		return result;
	}




}
